from flask import jsonify
import http


class RespCode:
    Success = 0
    Error = -1
    ReqParamError = 4
    ReqParamUnFill = 41
    ResultNotExist = 42
    SvcErr = 5


def resp_platform(code=RespCode.Success, msg="操作成功", data: object = None, count=None) -> (
        dict, int):
    """
    AI平台
    """
    if count:
        return {"success": True, "code": code, "msg": str(msg), "data": data,
                "count": count}, http.HTTPStatus.OK
    else:
        return {"success": True, "code": code, "msg": str(msg), "data": data}, http.HTTPStatus.OK
